import {
    requestCateGoryList,  //三级列表请求
} from "@/api"

//Vuex的home模块配置
const state = {
    //保存三级列表的数据
    categoryList: []
}

const mutations = {
    //1.设置categoryList值的mutations方法
    SET_CATEGORYLIST_STATE (state , value){
        state.categoryList = value
    },

   
}

const actions = {
    //1.请求三级列表actions
    async getCateGoryList({commit}){
        //发送请求拿到数据
        const result = await requestCateGoryList()
        //把数据交给commit
        commit("SET_CATEGORYLIST_STATE" , result)
    }
}

const getters = {}

export default {
    //开启命名空间
    namespaced: true,
    state,
    mutations,
    actions,
    getters
}
